<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
<h:head>
	<title>Journaldev Tutorial</title>
</h:head>
<h:body>
	<h:form enctype="multipart/form-data" style="width:500px"
		id="formulario">
		<p:growl id="messages" showDetail="true" />

		<p:inputText id="txtNombre" value="#{pacienteFotosMB.nombrePaciente}" />

		<p:fileUpload 
			fileUploadListener="#{pacienteFotosMB.handleFileUpload}"
			value="#{pacienteFotosMB.fotoPaciente}" 
			mode="advanced"
			dragDropSupport="false" 
			update="messages" 
			sizeLimit="100000"
			fileLimit="3" 
			allowTypes="/(\.|\/)(gif|jpe?g|png)$/"/>

		<p:commandButton 
			id="btnEnviar" 
			disabled="false" 
			value="Enviar formulario"
			action="#{pacienteFotosMB.enviarDatos}" 
			update="formulario"
			ajax="true" />

		<h:graphicImage value="/images/downloaded_optimus.jpg" />
	</h:form>
</h:body>
</html>